<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  function hasAuthority(res,target){
      let list = res.split(",");
      console.log(list)
      let flag = false;
      list.some((item,index) => {
        console.log("正在搜索");
        if(item === target){
          console.log("找到了");
          flag = true;
          return true;
        }
      });
      return flag;
    }

    function hasAuthority2(res,target){
      let list = res.split(",");
      console.log(list)
      let flag = false;
      for(let i = 0;i < list.length; i++){
        console.log("正在搜索");
        if(list[i] === target){
          console.log("找到了");
          flag = true;
          break;
        }
      }
      return flag;
    }

    var list = "1,23123123,33123,4123123,53213,63123";
    var t = "53213";
    console.log(hasAuthority2(list,t));
    // for(var i = 0;i<5;i++){
    //   console.log(i)
    //   if(i== 3){
    //     break;
    //   }
    // }
</script>
</html>